import javax.swing.JPanel;
import java.awt.Frame;
import java.awt.BorderLayout;
import javax.swing.JDialog;
import java.awt.GridBagLayout;
import java.awt.Rectangle;
import javax.swing.JButton;
//////////////////////////////////////////////////////////////////////////
// 
//

public class IPPortSettingDialog extends JDialog {

	private static final long serialVersionUID = 1L;
	public IPPortSettingPane settingPane = null;
	private JButton jButtonCANCEL = null;
	private JButton jButtonOK = null;
	public boolean OK = false;
	
	/**
	 * @param owner
	 */
	public IPPortSettingDialog(Frame owner) {
		super(owner,true);
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(300, 200);
		this.setContentPane(getJPanel());
	}

	/**
	 * This method initializes jPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	public IPPortSettingPane getJPanel() {
		if (settingPane == null) {
			settingPane = new IPPortSettingPane();
			settingPane.setLayout(null);
			settingPane.setBounds(new Rectangle(0, 0, 284, 91));
			settingPane.add(getJButtonCANCEL(), null);
			settingPane.add(getJButtonOK(), null);
		}
		return settingPane;
	}

	/**
	 * This method initializes jButtonCANCEL	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButtonCANCEL() {
		if (jButtonCANCEL == null) {
			jButtonCANCEL = new JButton();
			jButtonCANCEL.setBounds(new Rectangle(30, 120, 106, 31));
			jButtonCANCEL.setText("CANCEL");
			jButtonCANCEL.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					settingPane.UpdateData(true);
					setVisible(false);
				}
			});
		}
		return jButtonCANCEL;
	}

	/**
	 * This method initializes jButtonOK	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButtonOK() {
		if (jButtonOK == null) {
			jButtonOK = new JButton();
			jButtonOK.setBounds(new Rectangle(165, 120, 106, 31));
			jButtonOK.setText("OK");
			jButtonOK.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					settingPane.UpdateData(false);
					OK = true;
					setVisible(false);
				}
			});
		}
		return jButtonOK;
	}

}
